﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;

namespace Service.ZSJL.Com.Security
{
    public class SHA1Encrypt : IEncrypt
    {
        public string EnCode(string source)
        {

            byte[] data = System.Text.Encoding.Default.GetBytes(source);//以字节方式存储
            SHA1 sha1 = new SHA1CryptoServiceProvider();
            byte[] result = sha1.ComputeHash(data);//得到哈希值
            return System.BitConverter.ToString(result).Replace("-", ""); //转换成为字符串的显示 }

        }

        public string EnCode(string pToEncrypt, string sKey)
        {
            throw new NotImplementedException();
        }

        public string DeCode(string source)
        {
            throw new NotImplementedException();
        }

        public string DeCode(string pToEncrypt, string sKey)
        {
            throw new NotImplementedException();
        }
    }
}
